package com.chushouya.order.dto.admin.order;

import com.chushouya.order.constants.OrderStatusEnum;
import com.chushouya.order.constants.OrderTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.general.framework.core.lang.Dates;
import com.general.framework.core.lang.Sensitives;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@ApiModel("订单信息")
@Data
public class OrderListApiDTO {
    @ApiModelProperty(value = "订单ID")
    private Long orderId;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("订单状态")
    private Integer orderStatus;

    @ApiModelProperty("交易方式")
    private Integer orderType;

    @ApiModelProperty("订单文案")
    private String orderStatusText;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("姓名")
    private String userName;

    @ApiModelProperty("手机号")
    private String userPhone;

    @ApiModelProperty("下单时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    @ApiModelProperty("完成时间")
    private Date completeTime;

    @ApiModelProperty("订单金额")
    private BigDecimal orderPrice;

    @ApiModelProperty("估价")
    private BigDecimal evaluatePrice;

    @ApiModelProperty("质检价")
    private BigDecimal qualityPrice;

    @ApiModelProperty("成交价")
    private BigDecimal completePrice;

    @ApiModelProperty("回收渠道")
    private String channel;

    @ApiModelProperty("订单商品")
    private Long productId;


    @ApiModelProperty("订单商品")
    private String productName;

    @ApiModelProperty("订单商品图片")
    private String productImage;

    @ApiModelProperty("订单最后操作记录")
    private String lastRemark;

    @ApiModelProperty("订单备注")
    private String orderRemark;

    @ApiModelProperty("合作商订单号")
    private String partnerOrderNo;

    public String getOrderTypeText() {
        return OrderTypeEnum.getDesc(this.orderType);
    }

    public String getOrderStatusText() {
        return OrderStatusEnum.getDesc(this.orderStatus);
    }

    public String getUserPhone() {
        return Sensitives.mobile(this.userPhone);
    }

}
